package cn.school.filter;///*
//package cn.school.filter;
//
//import javax.servlet.*;
//import javax.servlet.annotation.WebFilter;
//import javax.servlet.http.HttpServletRequest;
//import java.io.IOException;
//
//*/
///**
// * @author oldliu
// * @since 1.0
// *//*
//
////web.xml   servlet-   filter
//@WebFilter(filterName = "AAA",value = "/*")
//public class ExecTimeFilter implements Filter {
//    @Override
//    public void init(FilterConfig filterConfig) throws ServletException {
//        System.out.println("time init ");
//    }
//
//    @Override
//    public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException {
//        System.out.println("进入了：TimeFilter");
//        HttpServletRequest request=(HttpServletRequest)servletRequest;
//        //request.setCharacterEncoding(?);
//        long start=System.nanoTime();//开始时间
//        String path=request.getServletPath();//请求地址
//        filterChain.doFilter(request,servletResponse);//放行！！！！！
//        long end=System.nanoTime();
//        System.out.println("执行"+path+"花费了"+(end-start)+"纳秒");
//        System.out.println("离开了：TimeFilter");
//    }
//
//    @Override
//    public void destroy() {
//        System.out.println("time destroy ");
//    }
//}
//*/
